import React from 'react';
import ReactDOM from 'react-dom/client';
import type { Root } from 'react-dom/client';
import { RouterProvider } from 'react-router-dom';
import { Provider } from 'react-redux';
import router from '@/router';
import store from '@/store';
import '@/styles/index.scss';
import 'nprogress/nprogress.css';
import '@/assets/index';



const root: Root = ReactDOM.createRoot(document.getElementById('root') as HTMLDivElement);

store.subscribe(() => {
  localStorage.setItem('consultInfo', JSON.stringify(store.getState().consultStore.consultInfo));
});

root.render(
  <Provider store={store}>
    <RouterProvider router={router}></RouterProvider>
  </Provider>,
);
